// MENU
$height-menu-list: 50px;
$menu-category-list-item-height: 40px;

.menu-panel{
  z-index: 10;
  overflow: auto;
  position: fixed;
  top: $height-navbar;
  left: 0;
  width: 100%;
  background-color: $bg-menu;
}

.menu-list{
  display: flex;
  flex-flow: column;
  justify-content: space-between;
}

.menu-list-group{
  display: block;
  list-style-type: none;
  padding: 30px 30px;
}

.menu-list-group-item{
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  position: relative;
  font-size: 20px;
  height: $height-menu-list;
  line-height: $height-menu-list;
  padding: 0 15px;
  color: white;
  @extend .unselectable;
  @include border-radius($radius-pc);
  overflow: hidden;
  &:after{
    width: 100%;
    bottom: 0;
    left: 0;
    content: '';
    display: block;
    background-color: $color-border-menu;
    height: 1px;
    position: absolute;
    transform-origin: 0 100%;
    transform: scaleY(0.5);
  }
  &:active{
    background-color: lighten($bg-menu,10%);
  }
  .addon{
    margin-top: 2px; // 抵消靠上的显示错觉
    font-size: 16px;
    line-height: 1;
    color: $text-menu-second;
  }
}

.menu-btn {
  flex-shrink: 0;
  position: relative;
  display: block;
  text-align: center;
  width: 45%;
  margin-bottom: 20px;
  font-size: 20px;
  color: white;
  line-height: $menu-category-list-item-height;
  border: 1px solid $color-main;
  background-color: $color-main;
  @include border-radius(5px);
  @extend .btn-like;
}


// 菜单中的类别标识
.category-indicator{
  display: flex;
  justify-content: flex-start;
  $height: 10px;
  .item{
    margin-left: 5px;
    height: $height;
    width: $height;
    display: block;
    @include border-radius($height + 10);
    border: 1px dotted transparent;
  }
  @each $name, $color in $categories {
    .category-#{$name}{
      border-color: $color;
      &.active{
        background-color: $color;
      }
    }
  }

  // shared 指示器
  .category-shared{
    border-color: white;
    &.active{
      background-color: white;
    }
  }
}

.user-info-panel{
  padding: 30px 80px;
}
.user-info{
  padding: 10px 20px;
  @include border-radius($radius-pc);
  display: flex;
  background-color: transparentize(white, 0.9);
  justify-content: center;
  align-items: center;
  line-height: 1.5;
  font-size: 13px;
  white-space: nowrap;
  color: $text-about-subtitle;
  .user{
    width: 50%;
    flex-grow: 1;
    padding: 5px 5% 5px 0;
    .username{
    }
    .email{
      min-font-size: 10px;
    }
  }
  .statistics{
    width: 40%;
    padding: 5px 0 5px 5%;
    border-left: 1px solid transparentize(white, 0.9);;
  }
}

// MENU CATEGORY
.menu-category {
  padding: 20px;
}

.menu-category-list{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-flow: row wrap;
}
.menu-category-item {
  flex-shrink: 0;
  position: relative;
  display: block;
  text-align: center;
  width: 45%;
  @extend .btn-like;
  .count{
    color: white;
    display: block;
    position: absolute;
    top: 5px;
    right: 7px;
    font-size: 10px;
    line-height: 1;
  }
  label{
    @extend .btn-like;
  }
  input[type=checkbox] + label {
    @extend .unselectable;
    width: 100%;
    display: block;
    margin-bottom: 20px;
    font-size: 20px;
    color: white;
    line-height: $menu-category-list-item-height;
    @include border-radius(5px);
    border: 1px dashed $gray;
    &.menu-category-shared{
      background-color: transparent;
    }
  }
  @each $name, $color in $categories {
    input[type=checkbox]:checked + label {
      &.menu-category-#{$name} {
        background-color: $color;
        border-color: $color;
        @if $name== 'shared'{
          color: black;
        }
      }
    }
  }
}

.category-operations-container{
  padding-top: 20px;
  border-top: 1px solid $bg-main;
}


// PC
@media (min-width: $grid-separate-width-big) {
  .menu-panel {
    width: $menu-panel-big;
  }
  .menu-category {
    padding: 30px;
    .menu-category-item {
      width: 40%;
    }
  }
}

// PC & IPAD
@media (min-width: $grid-separate-width-md) and (max-width: $grid-separate-width-big) {
  .menu-panel{
    width: $menu-panel-sm;
  }
  .user-info-panel{
    padding: 30px 50px;
  }
  .menu-category {
    padding: 30px;
    .menu-category-item {
      width: 40%;
    }
  }
}
